package ioperations;

import Book.BookList;
import Book.Books;

import java.util.Scanner;

public class Put implements Ioperation{
    @Override
    public void work(BookList bookList) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入书名：");
        String Name = scanner.nextLine();
        System.out.println("请输入作者");
        String Author = scanner.nextLine();
        System.out.println("请输入售价：");
        int Prize = scanner.nextInt();
        scanner.nextLine();
        System.out.println("请输入类型：");
        String Type = scanner.nextLine();
        Books books = new Books(Name,Author,Prize,Type);
        bookList.books[bookList.Size++] = books;
        System.out.println("增添图书成功！");
    }
}
